# Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Contributor: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lomiri-download-manager
pkgver=0.1.2
pkgrel=1
pkgdesc="Provides a service for downloading files while an application is suspended"
arch="all"
url="https://gitlab.com/ubports/development/core/lomiri-download-manager"
license="LGPL-3.0-only"
depends_dev="
	boost-dev
	glog-dev
	gtest-dev
	lomiri-api-dev
	qt5-qtdeclarative-dev
	qt5-qttools-dev
	"
makedepends="
	$depends_dev
	cmake
	cmake-extras
	doxygen
	gmock
	graphviz
	samurai
	"
checkdepends="dbus-test-runner xvfb-run"
source="https://gitlab.com/ubports/development/core/lomiri-download-manager/-/archive/$pkgver/lomiri-download-manager-$pkgver.tar.gz
	0001-Upgrade-C-standard-to-C-17.patch
	0002-Disable-Werror.patch
	0003-docs-use-qdoc-qt5-directly-instead-of-qtswitcher.patch
	0004-Fix-install-path-for-pkgconfig-files.patch
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
5cd7cab7503898e04e40166684eeaadbf7c614b7147e5f032b9372f81519df0fc47d44c3398721ee92519cef9fa5f9fe6889491714696cf27344ece0d0df30f3  lomiri-download-manager-0.1.2.tar.gz
a33ba6585f3fa484e42dada19fa10fc61a318b55de025fe1a1c57ae40ee98149f43b5ce3dfcc74a02a0707a4501731a5ddd5c7d74ffb4c1c9e868c0834af6a01  0001-Upgrade-C-standard-to-C-17.patch
9bd033db4deecfebe214b5569ceacda83abede4501255f2428880ea7352b9229bd9b9ba433da4f1fb5ef96c5d455dae5365877b152ef9c507939e69fef98f170  0002-Disable-Werror.patch
67d500b9a024668b496cce589a5b0fe1aa642b893a4e7d7705b7aa0c79c2961fbf5807e921a3ab588a0cdf91241dc90da5bb25b6210aeb4c3b0635a378d8b556  0003-docs-use-qdoc-qt5-directly-instead-of-qtswitcher.patch
6c31b0c9ba2fdc84429896bf0fc2008bf376f0eb91cb8d3a361f1e77012d802bb9b1e28bf2727d79d58ab16c84041e0e44a2b77730ded8dbdbbe5b305bf706a5  0004-Fix-install-path-for-pkgconfig-files.patch
"
